"use strict";

var drawFlags = {};

drawFlags.large = function (id, cross, color)  {
    var canvas = document.getElementById(id);  
    var ctx = canvas.getContext("2d");
    ctx.fillStyle = color;  
    ctx.fillRect (0, 0, 160, 100);  
    ctx.strokeStyle = "#ffffff";
    ctx.lineWidth = 11;
    if (cross === "Middle_cross") {
	    ctx.beginPath();  
	    ctx.moveTo(0,50);  
	    ctx.lineTo(160,50);  
	    ctx.stroke(); 
	    ctx.beginPath();  
	    ctx.moveTo(80,0);  
	    ctx.lineTo(80,100);  
	    ctx.stroke(); 
    }
    if (cross === "Corner_cross") {
	    ctx.beginPath();  
	    ctx.moveTo(0,0);  
	    ctx.lineTo(160,100);  
	    ctx.stroke(); 
	    ctx.beginPath();  
	    ctx.moveTo(160,0);  
	    ctx.lineTo(0,100);  
	    ctx.stroke(); 
    }
};

drawFlags.smallCrosses = function() {
	var canvas = document.getElementById("Middle_cross");  
    var ctx = canvas.getContext("2d");
    ctx.strokeStyle = "#ffffff";
    ctx.lineWidth = 3;
    ctx.beginPath();  
    ctx.moveTo(0,12);  
    ctx.lineTo(40,12);  
    ctx.stroke(); 
    ctx.beginPath();  
    ctx.moveTo(20,0);  
    ctx.lineTo(20,25);  
    ctx.stroke(); 

	var canvas = document.getElementById("Corner_cross");  
    var ctx = canvas.getContext("2d");
    ctx.strokeStyle = "#ffffff";
    ctx.lineWidth = 3;
    ctx.beginPath();  
    ctx.moveTo(0,0);  
    ctx.lineTo(40,25);  
    ctx.stroke(); 
    ctx.beginPath();  
    ctx.moveTo(40,0);  
    ctx.lineTo(0,25);  
    ctx.stroke(); 
}
